package com.iknow.view.widget.media;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import com.iknow.IKnow;
import com.iknow.net.NetFileInfo;
import com.iknow.service.MusicPlayBinder;
import com.iknow.task.GenericTask;
import com.iknow.task.TaskAdapter;
import com.iknow.task.TaskListener;
import com.iknow.task.TaskParams;
import com.iknow.task.TaskResult;
import com.iknow.util.LogUtil;
import com.iknow.util.MsgDialog;
import com.iknow.util.StringUtil;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class IKAudioView extends FrameLayout
{
  protected static IKAudioInfo currentAudioInfo;
  protected static MediaPlayer mediaPlayer = new MediaPlayer();
  protected static AudioPlayTask playTask = null;
  protected IKAudioInfo audioInfo;
  public ImageButton btn_pause;
  public ImageButton btn_start;
  protected Lyric lrc;
  protected ImageButton mBtnPause;
  protected ImageButton mBtnStart;
  protected ImageButton mBtnStop;
  private Context mContext;
  protected ProgressBar mPbarLoading;
  private PlayServiceConnection mPlayServiceConnection;
  private MusicplayReciver mReciver;
  private Intent mServiceIntent;
  private TaskListener mTaskListener;
  private Lyric.IKLyricController mediaPlayerController;
  protected List<View.OnLongClickListener> onLongClickLListenerList = new ArrayList();
  protected List<View.OnTouchListener> onTouchListenerList = new ArrayList();

  static
  {
    currentAudioInfo = null;
  }

  public IKAudioView(Context paramContext)
  {
    super(paramContext);
    this.lrc = null;
    this.audioInfo = null;
    this.mBtnStop = null;
    this.mBtnStart = null;
    this.mBtnPause = null;
    this.mPbarLoading = null;
    this.mServiceIntent = new Intent("com.iknow.playservice");
    this.mediaPlayerController = new Lyric.IKLyricController(this)
    {
      public long getCurrentPosition()
      {
        synchronized (IKAudioView.access$0(this.this$0))
        {
          long l = IKAudioView.access$0(this.this$0).getCurrentPosition();
          return l;
        }
      }

      // ERROR //
      public boolean isPlay()
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   4: invokestatic 23	com/iknow/view/widget/media/IKAudioView:access$0	(Lcom/iknow/view/widget/media/IKAudioView;)Lcom/iknow/view/widget/media/IKAudioView$PlayServiceConnection;
        //   7: astore_1
        //   8: aload_1
        //   9: monitorenter
        //   10: aload_0
        //   11: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   14: invokestatic 23	com/iknow/view/widget/media/IKAudioView:access$0	(Lcom/iknow/view/widget/media/IKAudioView;)Lcom/iknow/view/widget/media/IKAudioView$PlayServiceConnection;
        //   17: invokevirtual 32	com/iknow/view/widget/media/IKAudioView$PlayServiceConnection:isPlaying	()Z
        //   20: ifeq +26 -> 46
        //   23: aload_0
        //   24: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   27: getfield 36	com/iknow/view/widget/media/IKAudioView:audioInfo	Lcom/iknow/view/widget/media/IKAudioInfo;
        //   30: getstatic 39	com/iknow/view/widget/media/IKAudioView:currentAudioInfo	Lcom/iknow/view/widget/media/IKAudioInfo;
        //   33: invokevirtual 45	com/iknow/view/widget/media/IKAudioInfo:equals	(Ljava/lang/Object;)Z
        //   36: ifeq +10 -> 46
        //   39: aload_1
        //   40: monitorexit
        //   41: iconst_1
        //   42: istore_3
        //   43: goto +15 -> 58
        //   46: aload_1
        //   47: monitorexit
        //   48: iconst_0
        //   49: istore_3
        //   50: goto +8 -> 58
        //   53: astore_2
        //   54: aload_1
        //   55: monitorexit
        //   56: aload_2
        //   57: athrow
        //   58: iload_3
        //   59: ireturn
        //
        // Exception table:
        //   from	to	target	type
        //   10	56	53	finally
      }

      public void moveTo()
      {
        synchronized (IKAudioView.access$0(this.this$0))
        {
          IKAudioView.access$0(this.this$0).seekTo((int)paramLong);
          return;
        }
      }

      public void play()
      {
        synchronized (IKAudioView.mediaPlayer)
        {
          this.this$0.audioInfo.setPlayTime(paramLong);
          this.this$0.action_start();
          return;
        }
      }
    };
    this.mTaskListener = new TaskAdapter(this)
    {
      public String getName()
      {
        return "AudioTask";
      }

      public void onCancelled()
      {
      }

      public void onPostExecute(, TaskResult paramTaskResult)
      {
        if (paramTaskResult == TaskResult.OK)
          IKAudioView.access$2(this.this$0);
        while (true)
        {
          do
            while (true)
            {
              return;
              if (paramTaskResult != TaskResult.READ_LOCAL)
                break;
              IKAudioView.access$2(this.this$0);
            }
          while (paramTaskResult != TaskResult.FAILED);
          IKAudioView.access$3(this.this$0, ((IKAudioView.AudioTask)paramGenericTask).getMsg());
        }
      }

      public void onPreExecute()
      {
        IKAudioView.access$1(this.this$0);
      }

      public void onProgressUpdate(, Object paramObject)
      {
        TaskParams localTaskParams = (TaskParams)paramObject;
        try
        {
          IKAudioView.access$4(this.this$0, localTaskParams.getInt("pos"));
          return;
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
        }
      }
    };
    this.mContext = paramContext;
    initView();
  }

  public IKAudioView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.lrc = null;
    this.audioInfo = null;
    this.mBtnStop = null;
    this.mBtnStart = null;
    this.mBtnPause = null;
    this.mPbarLoading = null;
    this.mServiceIntent = new Intent("com.iknow.playservice");
    this.mediaPlayerController = new Lyric.IKLyricController(this)
    {
      public long getCurrentPosition()
      {
        synchronized (IKAudioView.access$0(this.this$0))
        {
          long l = IKAudioView.access$0(this.this$0).getCurrentPosition();
          return l;
        }
      }

      // ERROR //
      public boolean isPlay()
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   4: invokestatic 23	com/iknow/view/widget/media/IKAudioView:access$0	(Lcom/iknow/view/widget/media/IKAudioView;)Lcom/iknow/view/widget/media/IKAudioView$PlayServiceConnection;
        //   7: astore_1
        //   8: aload_1
        //   9: monitorenter
        //   10: aload_0
        //   11: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   14: invokestatic 23	com/iknow/view/widget/media/IKAudioView:access$0	(Lcom/iknow/view/widget/media/IKAudioView;)Lcom/iknow/view/widget/media/IKAudioView$PlayServiceConnection;
        //   17: invokevirtual 32	com/iknow/view/widget/media/IKAudioView$PlayServiceConnection:isPlaying	()Z
        //   20: ifeq +26 -> 46
        //   23: aload_0
        //   24: getfield 14	com/iknow/view/widget/media/IKAudioView$1:this$0	Lcom/iknow/view/widget/media/IKAudioView;
        //   27: getfield 36	com/iknow/view/widget/media/IKAudioView:audioInfo	Lcom/iknow/view/widget/media/IKAudioInfo;
        //   30: getstatic 39	com/iknow/view/widget/media/IKAudioView:currentAudioInfo	Lcom/iknow/view/widget/media/IKAudioInfo;
        //   33: invokevirtual 45	com/iknow/view/widget/media/IKAudioInfo:equals	(Ljava/lang/Object;)Z
        //   36: ifeq +10 -> 46
        //   39: aload_1
        //   40: monitorexit
        //   41: iconst_1
        //   42: istore_3
        //   43: goto +15 -> 58
        //   46: aload_1
        //   47: monitorexit
        //   48: iconst_0
        //   49: istore_3
        //   50: goto +8 -> 58
        //   53: astore_2
        //   54: aload_1
        //   55: monitorexit
        //   56: aload_2
        //   57: athrow
        //   58: iload_3
        //   59: ireturn
        //
        // Exception table:
        //   from	to	target	type
        //   10	56	53	finally
      }

      public void moveTo()
      {
        synchronized (IKAudioView.access$0(this.this$0))
        {
          IKAudioView.access$0(this.this$0).seekTo((int)paramLong);
          return;
        }
      }

      public void play()
      {
        synchronized (IKAudioView.mediaPlayer)
        {
          this.this$0.audioInfo.setPlayTime(paramLong);
          this.this$0.action_start();
          return;
        }
      }
    };
    this.mTaskListener = new TaskAdapter(this)
    {
      public String getName()
      {
        return "AudioTask";
      }

      public void onCancelled()
      {
      }

      public void onPostExecute(, TaskResult paramTaskResult)
      {
        if (paramTaskResult == TaskResult.OK)
          IKAudioView.access$2(this.this$0);
        while (true)
        {
          do
            while (true)
            {
              return;
              if (paramTaskResult != TaskResult.READ_LOCAL)
                break;
              IKAudioView.access$2(this.this$0);
            }
          while (paramTaskResult != TaskResult.FAILED);
          IKAudioView.access$3(this.this$0, ((IKAudioView.AudioTask)paramGenericTask).getMsg());
        }
      }

      public void onPreExecute()
      {
        IKAudioView.access$1(this.this$0);
      }

      public void onProgressUpdate(, Object paramObject)
      {
        TaskParams localTaskParams = (TaskParams)paramObject;
        try
        {
          IKAudioView.access$4(this.this$0, localTaskParams.getInt("pos"));
          return;
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
        }
      }
    };
    this.mContext = paramContext;
    initView();
  }

  private void initView()
  {
  }

  private void linkListener()
  {
    View localView = findViewById(2131296263);
    if (localView == null)
      throw new RuntimeException("Can Not Found R.id.lyric_view");
    localView.setOnTouchListener(new View.OnTouchListener(this)
    {
      public boolean onTouch(, MotionEvent paramMotionEvent)
      {
        Iterator localIterator = this.this$0.onTouchListenerList.iterator();
        if (!(localIterator.hasNext()));
        while (true)
          do
            return false;
          while (!(((View.OnTouchListener)localIterator.next()).onTouch(paramView, paramMotionEvent)));
      }
    });
    localView.setOnLongClickListener(new View.OnLongClickListener(this)
    {
      public boolean onLongClick()
      {
        Iterator localIterator = this.this$0.onLongClickLListenerList.iterator();
        if (!(localIterator.hasNext()));
        while (true)
          do
            return false;
          while (!(((View.OnLongClickListener)localIterator.next()).onLongClick(paramView)));
      }
    });
  }

  private void onBeginToDownload()
  {
  }

  private void onDownloadFailure(String paramString)
  {
  }

  private void onDownloadProgress(int paramInt)
  {
  }

  private void onDownloadSuccess()
  {
  }

  private void setupListener()
  {
    this.mBtnStop.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.action_stop();
      }
    });
    this.mBtnPause.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.action_pause_ex();
      }
    });
    this.mBtnStart.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.action_start();
      }
    });
    mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener(this)
    {
      public void onCompletion()
      {
        this.this$0.action_stop();
      }
    });
    mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener(this)
    {
      public boolean onError(, int paramInt1, int paramInt2)
      {
        this.this$0.action_stop();
        return false;
      }
    });
  }

  public static void stopPlayer()
  {
    if ((mediaPlayer != null) && (mediaPlayer.isPlaying()))
      mediaPlayer.stop();
    if (playTask != null)
    {
      playTask.stop();
      playTask = null;
    }
    currentAudioInfo = null;
  }

  public void action_pause()
  {
    if (!(this.mediaPlayerController.isPlay()));
    while (true)
    {
      return;
      int i = mediaPlayer.getCurrentPosition();
      action_stop();
      this.mBtnStop.setVisibility(4);
      this.audioInfo.setPlayTime(i);
    }
  }

  public void action_pause_ex()
  {
    if (!(this.mPlayServiceConnection.isPlaying()))
    {
      this.mBtnStart.setVisibility(4);
      this.mBtnStop.setVisibility(0);
      this.mPlayServiceConnection.play();
    }
    while (true)
    {
      if (this.btn_start != null)
        this.btn_start.setVisibility(0);
      if (this.btn_pause != null)
        this.btn_pause.setVisibility(8);
      return;
      int i = (int)this.mPlayServiceConnection.getCurrentPosition();
      this.audioInfo.setPlayTime(i);
      this.mBtnStart.setVisibility(0);
      this.mBtnStop.setVisibility(4);
      this.mBtnPause.setVisibility(4);
      this.mPlayServiceConnection.pause();
    }
  }

  public void action_start()
  {
    IKnow.IsNetAviable();
    if ((this.mPlayServiceConnection.bConnected()) && (!(this.mPlayServiceConnection.bStoped())))
    {
      this.mPlayServiceConnection.seekTo(this.audioInfo.getPlayTime());
      this.mPlayServiceConnection.start();
      this.mBtnStart.setVisibility(4);
      this.mBtnStop.setVisibility(0);
      this.mBtnPause.setVisibility(4);
      this.btn_start.setVisibility(8);
      this.btn_pause.setVisibility(0);
    }
    while (true)
    {
      return;
      stopPlayer();
      playTask = new AudioPlayTask(this, null);
      this.mBtnPause.setVisibility(4);
      AudioPlayTask localAudioPlayTask = playTask;
      String[] arrayOfString = new String[1];
      arrayOfString[0] = this.audioInfo.getUrl();
      localAudioPlayTask.execute(arrayOfString);
      this.btn_start.setVisibility(8);
    }
  }

  public void action_stop()
  {
    this.audioInfo.setPlayTime(0L);
    stopPlayer();
    this.lrc.stop();
    this.mBtnStart.setVisibility(0);
    this.mBtnStop.setVisibility(4);
    this.mBtnPause.setVisibility(4);
    this.mPbarLoading.setVisibility(4);
    this.mPlayServiceConnection.stop();
    this.btn_start.setVisibility(0);
    if (this.btn_pause.getVisibility() == 0)
      this.btn_pause.setVisibility(8);
  }

  public void closePlayService()
  {
    if (this.mPlayServiceConnection.bConnected())
    {
      this.mContext.unregisterReceiver(this.mReciver);
      this.mContext.unbindService(this.mPlayServiceConnection);
      this.mContext.stopService(this.mServiceIntent);
    }
  }

  public Lyric getLrc()
  {
    return this.lrc;
  }

  public void refresh()
  {
    this.lrc.refresh();
  }

  public void setAudioActionButton(ImageButton paramImageButton1, ImageButton paramImageButton2)
  {
    this.btn_start = paramImageButton1;
    this.btn_start.getBackground().setAlpha(125);
    this.btn_pause = paramImageButton2;
    this.btn_pause.getBackground().setAlpha(125);
    paramImageButton2.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.action_pause_ex();
      }
    });
    paramImageButton1.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.action_start();
      }
    });
  }

  public void setOnLongClickListener(View.OnLongClickListener paramOnLongClickListener)
  {
    if (!(this.onLongClickLListenerList.contains(paramOnLongClickListener)))
      this.onLongClickLListenerList.add(paramOnLongClickListener);
  }

  public void setOnTouchListener(View.OnTouchListener paramOnTouchListener)
  {
    if (!(this.onTouchListenerList.contains(paramOnTouchListener)))
      this.onTouchListenerList.add(paramOnTouchListener);
  }

  public void setup(IKAudioInfo paramIKAudioInfo)
  {
    if (paramIKAudioInfo == null)
      throw new NullPointerException("IKAudioInfo Is Null !!!");
    this.audioInfo = paramIKAudioInfo;
    this.lrc = new Lyric(paramIKAudioInfo.getLrc());
    this.lrc.registerLrcView(this, this.mediaPlayerController);
  }

  private class AudioPlayTask extends AsyncTask<String, String, String>
  {
    private boolean isStop = false;

    protected String doInBackground()
    {
      if ((this.isStop) && (StringUtil.isEmpty(paramArrayOfString[0])));
      while (true)
      {
        return null;
        if ((0 != 0) && (null.exists()) && (null.length() > 0L));
      }
    }

    protected void onPostExecute()
    {
      this.this$0.mBtnStart.setVisibility(4);
      this.this$0.mBtnStop.setVisibility(0);
      this.this$0.mPbarLoading.setVisibility(4);
      this.this$0.btn_pause.setVisibility(0);
      IKAudioView.mediaPlayer.reset();
      if ((!(StringUtil.isEmpty(paramString))) && (!(this.isStop)))
        try
        {
          if (!(IKAudioView.access$0(this.this$0).bConnected()))
          {
            IKAudioView.access$5(this.this$0).putExtra("audioUrl", paramString);
            IKAudioView.access$6(this.this$0).bindService(IKAudioView.access$5(this.this$0), IKAudioView.access$0(this.this$0), 1);
          }
          else
          {
            IKAudioView.access$0(this.this$0).play();
          }
        }
        catch (Exception localException)
        {
          MsgDialog.showToast(IKAudioView.access$6(this.this$0), "错误的文件格式");
          LogUtil.e(getClass(), localException);
          this.this$0.action_stop();
        }
    }

    protected void onPreExecute()
    {
      if (this.isStop);
      while (true)
      {
        return;
        this.this$0.mBtnStart.setVisibility(4);
        this.this$0.mBtnStop.setVisibility(4);
        this.this$0.mPbarLoading.setVisibility(0);
        this.this$0.mPbarLoading.setBackgroundColor(0);
      }
    }

    public void stop()
    {
      this.isStop = true;
    }
  }

  private class AudioTask extends GenericTask
  {
    private String mMsg;

    protected TaskResult _doInBackground()
    {
      if ((0 != 0) && (null.exists()) && (null.length() > 0L));
      this.mMsg = "网络超时，请稍后再试";
      return TaskResult.FAILED;
    }

    public String getMsg()
    {
      return this.mMsg;
    }
  }

  private class MusicplayReciver extends BroadcastReceiver
  {
    public void onReceive(, Intent paramIntent)
    {
      int i = paramIntent.getExtras().getInt("code");
      if (-1 == i)
        this.this$0.action_stop();
      while (true)
      {
        do
          return;
        while (i != 0);
        this.this$0.action_stop();
      }
    }
  }

  public class PlayServiceConnection
  implements ServiceConnection
  {
    private MusicPlayBinder mBinder;
    private boolean mConnected = false;
    private boolean mIsStoped = false;

    public boolean bConnected()
    {
      return this.mConnected;
    }

    public boolean bStoped()
    {
      return this.mIsStoped;
    }

    public long getCurrentPosition()
    {
      Parcel localParcel = Parcel.obtain();
      try
      {
        this.mBinder.transact(MusicPlayBinder.CODE_GET_CURRENT_POISION, null, localParcel, 0);
        return localParcel.readInt();
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public boolean isPlaying()
    {
      int i;
      if (this.mBinder == null)
      {
        i = 0;
        return i;
      }
      Parcel localParcel = Parcel.obtain();
      try
      {
        this.mBinder.transact(MusicPlayBinder.CODE_IS_PLAYING, null, localParcel, 0);
        boolean[] arrayOfBoolean = new boolean[1];
        localParcel.readBooleanArray(arrayOfBoolean);
        i = arrayOfBoolean[0];
      }
      catch (RemoteException localRemoteException)
      {
        while (true)
          localRemoteException.printStackTrace();
      }
    }

    public void onServiceConnected(, IBinder paramIBinder)
    {
      this.mBinder = ((MusicPlayBinder)paramIBinder);
      IKAudioView.access$6(this.this$0).startService(IKAudioView.access$5(this.this$0));
      IKAudioView.access$7(this.this$0, new IKAudioView.MusicplayReciver(this.this$0, null));
      IntentFilter localIntentFilter = new IntentFilter();
      localIntentFilter.addAction("com.iknow.playservice");
      IKAudioView.access$6(this.this$0).registerReceiver(IKAudioView.access$8(this.this$0), localIntentFilter);
      this.mConnected = true;
      play();
    }

    public void onServiceDisconnected()
    {
      this.mBinder = null;
      this.mConnected = false;
    }

    public void pause()
    {
      try
      {
        this.mBinder.transact(MusicPlayBinder.CODE_PAUSE, null, null, 0);
        IKAudioView.currentAudioInfo = this.this$0.audioInfo;
        this.this$0.lrc.play();
        return;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public void play()
    {
      if (this.mBinder == null)
        return;
      Parcel localParcel = Parcel.obtain();
      try
      {
        localParcel.writeLong(this.this$0.audioInfo.getPlayTime());
        this.mBinder.transact(MusicPlayBinder.CODE_PLAY, localParcel, null, 0);
        IKAudioView.currentAudioInfo = this.this$0.audioInfo;
        this.this$0.lrc.play();
        this.mIsStoped = false;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public void seekTo()
    {
      Parcel localParcel = Parcel.obtain();
      try
      {
        localParcel.writeLong(paramLong);
        this.mBinder.transact(MusicPlayBinder.CODE_SEEK_TO, localParcel, null, 0);
        return;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public void setPlayTime()
    {
      Parcel localParcel = Parcel.obtain();
      localParcel.writeLong(paramLong);
      try
      {
        this.mBinder.transact(MusicPlayBinder.CODE_SET_PLAY_TIME, localParcel, null, 0);
        return;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public void start()
    {
      try
      {
        this.mBinder.transact(MusicPlayBinder.CODE_START, null, null, 0);
        IKAudioView.currentAudioInfo = this.this$0.audioInfo;
        this.this$0.lrc.play();
        this.mIsStoped = false;
        return;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }

    public void stop()
    {
      try
      {
        if (this.mBinder == null)
          return;
        this.mBinder.transact(MusicPlayBinder.CODE_STOP_PLAY, null, null, 0);
        this.mIsStoped = true;
      }
      catch (RemoteException localRemoteException)
      {
        localRemoteException.printStackTrace();
      }
    }
  }
}